package battle;

import java.util.ArrayList;
import java.util.List;

import util.Rand;
import entity.CardVo;

public class BattleService {
	public List<CardVo> getNpcCards(List<CardVo> list){
		if(list.size()<7){
			return list;
		}
		List<CardVo> npc=new ArrayList<CardVo>();
		Rand rand=new Rand();
		for(int i=0;i<6;i++){
			int r=rand.getRand(list.size());
			npc.add(list.get(r));
			list.remove(r);
		}
		return npc;		
	}
	
	public List<CardVo> getPlayerCards(List<CardVo> list){
		if(list.size()<7){
			return list;
		}
		List<CardVo> player=new ArrayList<CardVo>();
		Rand rand=new Rand();
		for(int i=0;i<6;i++){
			int r=rand.getRand(list.size());
			player.add(list.get(r));
			list.remove(r);
		}
		return player;		
	}
}
